//组件
export const Component = {
    menu:(data)=> {
        let i = "";
        if(data){
            data.forEach((value, index, array) => {
                i += `
                <ul class="x-menu">
                    <li class="x-menu-title">${value.title}</li><br>
                    <li class="x-username">${value.username}</li>
                    <li class="x-content">
                        <img class="x-menu-image" src=${JSON.parse(value.images)[0]}>
                        <span>${value.content}</span>
                        <span>${value.comment}</span>
                    </li>
                 </l>`
            });
        }
        return i;
    },
    homeEntryBox:()=>{
        return `<ul class="HomeEntry-box"><li class="HomeEntry-ask"><a>写文章</a></li><li>|</li><li class="HomeEntry-ask"><a>回答</a></li></ul>`
    },
    write:()=>{
        return new Promise((resolve)=>{
            resolve(`<div class="x-image-menu"><label>请选择图像文件：</label><input type="file" id="file_input" multiple/></div><input class="input-title" placeholder="请输入标题" /><span class="write-publish">发布</span><textarea class="content-publish" style="font-size: 20px;width: 100%;" placeholder="请输入内容" rows="30">`)
        })
    }
};